package com.lzy.cloud.ticket.train.servcie.impl;

import com.lzy.cloud.ticket.train.dtos.TrainPassengerDto;
import com.lzy.cloud.ticket.train.entity.TrainPassenger;
import com.lzy.cloud.ticket.train.mapper.TrainPassengerMapperExt;
import com.lzy.cloud.ticket.train.servcie.TrainPassengerService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by WIN7 on 2018/6/2.
 */
@Service
public class TrainPassengerServiceImpl implements TrainPassengerService {

    @Autowired
    private TrainPassengerMapperExt trainPassengerMapperExt;

    @Override
    public boolean createTrainPassenger(TrainPassengerDto trainPassengerDto) {
        return trainPassengerMapperExt.insertSelective(DozerUtils.map(trainPassengerDto,TrainPassenger.class))>0;
    }

    @Override
    public boolean updateTrainPassenger(TrainPassengerDto trainPassengerDto) {
        return trainPassengerMapperExt.updatePassenger(DozerUtils.map(trainPassengerDto,TrainPassenger.class))>0;
    }
}
